var output = document.getElementById("output");
var isIE = window.navigator.appName.indexOf("Microsoft") != -1;
var swf;
function writeEmbed(url,w,h,id) {
	var embed_str = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"";
	embed_str += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\"";
	embed_str += " width=\""+w+"\"";
	embed_str += " height=\""+h+"\"";
	embed_str += " id=\""+id+"\">";
	embed_str += "<param name=\"allowScriptAccess\" value=\"always\" />";
	embed_str += "<param name=\"allowNetworking\" value=\"all\" />";
	embed_str += "<param name=\"movie\" value=\""+url+"\" />";
	embed_str += "<embed type=\"application/x-shockwave-flash\"";
	embed_str += " allowScriptAccess=\"always\"";
	embed_str += " allowNetworking=\"all\"";
	embed_str += " src=\""+url+"\"";
	embed_str += " width=\""+w+"\"";
	embed_str += " height=\""+h+"\"";
	embed_str += " name=\""+id+"\">";
	embed_str += "</embed></object>";
	document.getElementById("swf").innerHTML = embed_str;
	swf = (isIE) ? window[id] : document[id];
	output.innerHTML += "SWF ["+id+"] has been genereated";
}
function relayMessage(str) {
	output.innerHTML += "Message: "+str+"<br/>";
	try {swf.relayMessage(str);}
	catch(e) {output.innerHTML += "Error calling swf.relayMessage()<br/>";}
}